Page({
  data: {
    chatList: [
      {
        avatar: '/subPackage/image/a1.png',
        message: '快来提问吧~ 有问必答',
      },
      {
        avatar: '/subPackage/image/a2.png',
        message: '来啦来啦，请听题！',
      },
    ],
    textObj: [
      { value: '', placeholder: "插入标题会更受欢迎    分享此刻的想法......" },
      { value: '', placeholder: "请提出你的问题！" },
    ],
    text_active: 0
  },
  onShow() {
    this.setData({ text_active: '0' })
  },
  onTabsChange(event) {
    this.setData({ text_active: event.detail.value })
  },
  onTextareaInput: function (event) {
    const value = event.detail.value;
    let { textObj, text_active } = this.data
    textObj[+text_active].value = value;
    this.setData({ textObj })
  },

  send() {
    // let { textObj, text_active } = this.data
    // if (!textObj[+text_active].value.trim().length) return;
    // textObj[+text_active].value = ''
    // this.setData({ textObj }, () => {
    //   wx.showToast({
    //     title: '已提交！',
    //   })
    // })
  }
})